package com.tjsinfo.tjsoa.vote.bo;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

import com.tjsinfo.tjsoa.Dao.IQbcDao;
import com.tjsinfo.tjsoa.vote.dao.ITVoteColumnDAO;
import com.tjsinfo.tjsoa.vote.vo.TVoteColumn;

public class TVoteColumnBO implements ITVoteColumnBO {
	
	private IQbcDao qbcDao;	
	private ITVoteColumnDAO columnDao;
	
	public IQbcDao getQbcDao() {
		return qbcDao;
	}
	public void setQbcDao(IQbcDao qbcDao) {
		this.qbcDao = qbcDao;
	}
	public ITVoteColumnDAO getColumnDao() {
		return columnDao;
	}
	public void setColumnDao(ITVoteColumnDAO columnDao) {
		this.columnDao = columnDao;
	}
	
	public void save(TVoteColumn transientInstance) {
		// TODO Auto-generated method stub
		columnDao.save(transientInstance);
	}
	public void delete(String id) {
		// TODO Auto-generated method stub
		columnDao.delete(id);
	}
	public void deleteC(String headId, String conformationId) {
		// TODO Auto-generated method stub
		columnDao.deleteC(headId, conformationId);
	}
	public TVoteColumn findById(String id) {
		// TODO Auto-generated method stub
		return columnDao.findById(id);
	}
	public List find(String headId){
		DetachedCriteria criteria = DetachedCriteria.forClass(TVoteColumn.class);
		criteria.add(Restrictions.eq("headId", headId));
		List list = qbcDao.getCriteria(criteria);
		return list;
	}

	public List findBy(String headId,String conformationId){
		DetachedCriteria criteria = DetachedCriteria.forClass(TVoteColumn.class);
		criteria.add(Restrictions.eq("headId", headId));
		criteria.add(Restrictions.eq("conId", conformationId));
		List list = qbcDao.getCriteria(criteria);
		return list;
	}
	public void deleteA(String headId) {
		// TODO Auto-generated method stub
		columnDao.deleteA(headId);
	}
}
